package org.example;

import org.foo.SayDriver;

import java.net.URL;
import java.net.URLClassLoader;
import java.util.ServiceLoader;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
//        System.out.println( "Hello World!" );
//        URLClassLoader systemClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
//        URL[] urLs = systemClassLoader.getURLs();
//        for (URL urL : urLs) {
//            System.out.println("urL = " + urL);
//        }
//
//
//        ClassLoader classLoader = Integer.class.getClassLoader();
//        System.out.println(classLoader);

        ServiceLoader<SayDriver> serviceLoader = ServiceLoader.load(SayDriver.class);
        serviceLoader.forEach(e -> e.say("Hello World!"));
    }
}
